﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DojoDefault.aspx.cs" Inherits="iSun.Web.DojoIndex" %>
<!DOCTYPE html>
<html>
<head>

	<meta http-equiv="Content-type" content="text/html; charset=utf-8">

	<title>iSun System</title>

	<script>
	    var startTime = new Date();
	</script>

	<!-- required: a default theme -->
	<link rel="stylesheet" href="dojo-release-1.7.2-src/dijit/themes/claro/document.css"/>
	<link rel="stylesheet" href="dojo-release-1.7.2-src/dijit/themes/claro/claro.css"/>
	<link rel="stylesheet" href="dojo-release-1.7.2-src/dijit/tests/css/dijitTests.css"/>

	<style type="text/css">
		html, body { height: 100%; width: 100%; padding: 0; border: 0; }
		#main { height: 100%; width: 100%; border: 0; top:0px;bottom:0;left:0;right:0; }
		#header { margin: 0; }
		#leftAccordion { width: 180px; }
		#bottomTabs { height: 40%; }
		#hs-1width {
			width:400px;
			height:40px;
		}
		/* pre-loader specific stuff to prevent unsightly flash of unstyled content */
		#loader {
			padding:0;
			margin:0;
			position:absolute;
			top:0; left:0;
			width:100%; height:100%;
			background:#ededed;
			z-index:999;
			vertical-align:middle;
		}
		#loaderInner {
			padding:5px;
			position:relative;
			left:0;
			top:0;
			width:175px;
			background:#3c3;
			color:#fff;
		}

		#indTestBar,
		#setTestBar {
			width:400px;
		}
		
		hr.spacer { border:0; background-color:#ededed; width:80%; height:1px; }

		/* rules used to test custom setting of TextBox padding */
		.inputPadding0 .dijitInputField { padding: 0 !important; }
		.inputPadding1 .dijitInputField { padding: 1px !important; }
		.inputPadding2 .dijitInputField { padding: 2px !important; }
		.inputPadding3 .dijitInputField { padding: 3px !important; }
		.inputPadding4 .dijitInputField { padding: 4px !important; }
		.inputPadding5 .dijitInputField { padding: 5px !important; }
	</style>

	<!-- a check for stray globals: not needed! -->
	<script type="text/javascript">
	    window.__globalList = { dojo: true, dijit: true, dojox: true, dojoConfig: true };
	    for (var i in window) {
	        window.__globalList[i] = true;
	    }

        

	</script>

	<!-- required: dojo.js -->
    
	<script type="text/javascript" src="dojo-release-1.7.2-src/dojo/dojo.js"
		data-dojo-config="parseOnLoad: false, async:true"></script>

	<!-- only needed for alternate theme testing: -->
	<%--<script type="text/javascript" src="dojo-release-1.7.2-src/tests/_testCommon.js"></script>--%>

	<script type="text/javascript">
	    var _addTabPage;
	    require([
			"dojo",
	        //"dojo/store",
			"dijit/dijit",
			"dijit/dijit-all",
			"dojo/parser",
			"dojo/date/locale",
			"dojo/data/ItemFileReadStore", //读缓存对象
            "dojo/data/ItemFileWriteStore", //写缓存对象
			"dojo/dnd/Source",
            "dijit/layout/BorderContainer", "dijit/layout/TabContainer", "dijit/layout/AccordionContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionPane", function (dojo, dijit) {

			    // various function ripped out of inline script type=dojo/* blocks
			    showDialog = function () {
			        var dlg = dijit.byId('dialog1');
			        dlg.show();
			        // avoid (trying to) restore focus to a closed menu, go to MenuBar instead
			        dlg._savedFocus = dojo.byId("header");
			    };

			    showDialogAb = function () {
			        var dlg = dijit.byId('dialogAB');
			        dlg.show();
			        // avoid (trying to) restore focus to a closed menu, go to MenuBar instead
			        dlg._savedFocus = dojo.byId("header");
			    };

			    //var setTextBoxPadding;
			    // current setting (if there is one) to override theme default padding on TextBox based widgets
			    var currentInputPadding = "";

			    setTextBoxPadding = function () {
			        // summary:
			        //		Handler for when a MenuItem is clicked to set non-default padding for
			        //		TextBox widgets

			        // Effectively ignore clicks on the	 currently checked MenuItem
			        if (!this.get("checked")) {
			            this.set("checked", true);
			        }

			        // val will be "theme default", "0px", "1px", ..., "5px"
			        var val = this.get("label");

			        // Set class on body to get requested padding, and remove any previously set class
			        if (currentInputPadding) {
			            dojo.removeClass(dojo.body(), currentInputPadding);
			            currentInputPadding = "";
			        }
			        if (val != "theme default") {
			            currentInputPadding = "inputPadding" + val.replace("px", "");
			            dojo.addClass(dojo.body(), currentInputPadding);
			        }

			        // Clear previously checked MenuItem (radio-button effect).
			        dojo.forEach(this.getParent().getChildren(), function (mi) {
			            if (mi != this) {
			                mi.set("checked", false);
			            }
			        }, this);
			    };

			    logStrayGlobals = function () {
			        // summary:
			        //		Print all the global variables that we've created [by mistake] inside of dojo
			        var strayGlobals = [];
			        for (var i in window) {
			            if (!window.__globalList[i]) {
			                strayGlobals.push(i);
			            }
			        }
			        if (strayGlobals.length) {
			            console.warn("Stray globals: " + strayGlobals.join(", "));
			        }
			    };

			    logWidgets = function () {
			        // summary:
			        //		Print all the widgets to console
			        console.log("Widgets in registry:");
			        dijit.registry.forEach(function (w) {
			            console.log(w);
			        });
			    };

			    tearDown = function () {
			        // summary:
			        //		Destroy all widgets, top down, and then check for any orphaned widgets
			        dijit._destroyAll();
			        logWidgets();
			    };

			    function initTree() {
			        var treeStore = new dojo.data.ItemFileWriteStore({ data:
                     {
                         identifier: 'id',
                         label: 'name',
                         items: [
                           { id: 1, name: 'Dijit Tree API', url: 'http://dojotoolkit.org/api/1.6/dijit.Tree', root: true,
                               children: [{ _reference: 2 }, { _reference: 3 }, { _reference: 4}]
                           },
                           { id: 2, name: '中华网', url: 'http://www.china.com' },
                           { id: 3, name: '凤岗网', url: 'http://www.ifeng.com' },
                           { id: 4, name: 'Dijit Tree.TreeStoreModel API', url: 'http://dojotoolkit.org/api/1.6/dijit.tree.TreeStoreModel' },
                        ]
                     }
			        });
			        var _data = { identifier: "ID", label: "Name", items: [{ ID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", Name: "ROOT", ParentID: "00000000-0000-0000-0000-000000000000", PathCode: "@001", children: [{ _reference: 'c4096f44-2f35-4cf2-b99a-09049aa9ef5d' }, { _reference: '37b40282-4c42-4b81-8d65-0f86c427fa4e' }, { _reference: 'd1253f7e-441b-4fb8-aa93-19e86a9dcf51' }, { _reference: 'd1253f7e-441b-4fb8-aa93-19e86a9dcf59' }, { _reference: 'ad40759f-0d17-4896-930a-3aab8d09c3e6' }, { _reference: '6c2bf6b4-cf1b-4e4d-8a4a-5be1c4e1b65f' }, { _reference: '67bcae26-16d1-4858-969c-8e643b966417' }, { _reference: 'e26e7d4b-70e0-4e11-82e2-a4efceab3249' }, { _reference: 'c32a92fa-5169-4714-bfa0-a54243facf62' }, { _reference: '2a36fc81-9f34-4282-9080-bebf41fcfe7f' }, { _reference: '523f637c-4be3-46ae-b428-cd1c879cdde0'}] }, { ID: "523f637c-4be3-46ae-b428-cd1c879cdde0", Name: "系统设置", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-001", children: [{ _reference: '17b26937-eb11-4623-885e-0481da0a6df0' }, { _reference: '1311d874-a6a9-4371-b0da-08650a942acf' }, { _reference: '798c2364-df3c-42e0-bb56-0fa75c07f95d' }, { _reference: '125f3471-24b0-4608-bd77-15ee4597d7ca' }, { _reference: '3167a02f-f0d2-4e4c-b74a-1db49441a716' }, { _reference: 'c8729555-62e7-4774-8c6d-1f325f3f65ce' }, { _reference: '35fee835-bd66-437e-8571-2bc7f0a55afe' }, { _reference: '50b8f88c-5273-4356-b176-32a14eda9458' }, { _reference: 'c2869e14-856c-4afb-8315-3fde45f4c608' }, { _reference: '959b7132-6e80-4735-b438-40701e3b380c' }, { _reference: 'a2c49e07-3648-43ff-ace0-5086e248876b' }, { _reference: '94dcc848-96db-4b87-9feb-5b96ba8d68be' }, { _reference: 'aef5f3fa-6ba9-4cb0-8dbd-64884b719d65' }, { _reference: '6ef5f3fa-6ba9-4cb0-8dbd-64884b719d6e' }, { _reference: '05f5a411-53de-4c54-95d7-798e67092c3a' }, { _reference: 'aae21856-93d7-4b18-8e31-7d5b0c7f0fa5' }, { _reference: '2ead86a9-14af-4a1a-bb4f-848bb304e5c4' }, { _reference: '320d07f1-6694-4ece-af9b-8794bc1f254a' }, { _reference: 'd20b38c2-1d32-4c89-b161-90694a8d7bda' }, { _reference: 'c0d9875f-7a78-4200-9bb4-a28dcf2f3eac' }, { _reference: 'f5b26324-a587-42e5-8557-aed68a8eb565' }, { _reference: '523f637c-4be3-46ae-b428-cd1c879cdd69' }, { _reference: 'c88408e4-64d5-49b0-a4d3-d2661c7d4009' }, { _reference: '6ea0a543-556e-4601-ba0a-dee633766993' }, { _reference: '28bd4e49-0817-4d74-8073-e5b2be9726ef' }, { _reference: '65916787-761f-4f3a-9561-ece89e7a2429' }, { _reference: 'a1ee533c-60e5-4ae9-bcf5-fd8173ed9053' }, { _reference: 'a1ee533c-60e5-4ae9-bcf5-fd8173ed9059'}] }, { ID: "f5b26324-a587-42e5-8557-aed68a8eb565", Name: "组织规划", ParentID: "523f637c-4be3-46ae-b428-cd1c879cdde0", PathCode: "@001-001-001", children: [{ _reference: '7c0f890e-3d57-4632-a17d-c80e6f0b6b70' }, { _reference: '46a97654-51c0-4628-91e1-d135a5b5e0b3' }, { _reference: '000e2a64-edda-4c0c-821f-e9656dbfbcae'}] }, { ID: "c32a92fa-5169-4714-bfa0-a54243facf62", Name: "客户管理", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-003", children: [{ _reference: '59a1b1da-c442-4ddf-b222-df0e871f38bd'}] }, { ID: "c4096f44-2f35-4cf2-b99a-09049aa9ef5d", Name: "帮助模块", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-004", children: [{ _reference: 'c4096f44-2f35-4cf2-b99a-09049aa9ef54' }, { _reference: 'c4096f44-2f35-4cf2-b99a-09049aa9ef55' }, { _reference: '2edc6e2a-65ce-4dff-9229-581b93f2af97'}] }, { ID: "2a36fc81-9f34-4282-9080-bebf41fcfe7f", Name: "培训管理", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-005", children: [{ _reference: 'aedf29d6-64e0-4144-b044-23a61f16420a' }, { _reference: 'e4758ab9-b0bc-4cf7-ae9a-51431b0737f1' }, { _reference: '79abf124-fec2-4f2b-a2c5-5e12ef767ebc' }, { _reference: '352f0bd6-1ad5-4957-8b9d-5f0aa744326a' }, { _reference: '944d1522-4ae1-422b-bdf6-727dc9457493' }, { _reference: 'e55783c9-b666-4644-a7c6-810085e53dbf' }, { _reference: 'afebde83-09df-4dc4-9e5b-86d2238a4d4e' }, { _reference: '8ec2b5ec-da4d-4c7f-bd49-9edfc9166d62' }, { _reference: '2e3fdb45-9d4c-4b90-bc63-bb0da4eeb252' }, { _reference: '2a36fc81-9f34-4282-9080-bebf41fcf47f' }, { _reference: '2c1434a8-5136-4d63-9c23-c53ad61fbc21' }, { _reference: '5bf4eb82-97da-44e1-84ed-e91dc258f309' }, { _reference: 'e2a1d62d-1489-4687-a8bd-eb3df48f46ed' }, { _reference: 'e2a1d62d-1489-4687-a8bd-eb3df48f46fd'}] }, { ID: "6c2bf6b4-cf1b-4e4d-8a4a-5be1c4e1b65f", Name: "问卷调研", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-006", children: [{ _reference: '7bc5008f-bca5-487e-9904-46054c09cf65' }, { _reference: '467a3b6f-2cc3-40ea-87d2-56fee30bf660' }, { _reference: '08acc0d3-9e04-4180-ac0e-e98b34a04db5'}] }, { ID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf59", Name: "CRM", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-007", children: [{ _reference: 'b73cb258-da69-4fa4-8b06-180e982e1dff' }, { _reference: '296837c9-6cc8-4ae9-a978-23c616372b96' }, { _reference: '296837c9-6cc8-4ae9-a978-23c616772b96' }, { _reference: '17eae1ad-6f95-44bb-a231-3bfb8276ae8f' }, { _reference: '27eae1ad-6f95-44bb-a231-3bfb8276ae8f' }, { _reference: 'f6b5968b-6d4f-498f-88b7-5a926cecdf95' }, { _reference: '4ee7ef05-8e23-4050-9973-b5bb328a827e' }, { _reference: '05134fbc-8955-48a1-950b-be77617bd4e5' }, { _reference: '523f637c-4be3-46ae-b428-cd1c879cdde1'}] }, { ID: "17eae1ad-6f95-44bb-a231-3bfb8276ae8f", Name: "客户管理", ParentID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf59", PathCode: "@001-007-001", children: [{ _reference: '7307bf9b-aa43-41f4-b4d4-29df8cb9743a' }, { _reference: '71d6c087-7300-45fd-9b1b-3900065d6ac0' }, { _reference: '37eae1ad-6f95-44bb-a231-3bfb8266ae8f' }, { _reference: '37eae1ad-6f95-44bb-a231-3bfb8276ae8f' }, { _reference: '0b77f14f-d022-4a55-80ab-462c86ebe747' }, { _reference: '1a345cf2-7cf9-47a9-9a23-49006079a9a0' }, { _reference: '18816217-27ea-44db-9bd0-5a8259df33f3' }, { _reference: 'c8816217-27ea-44db-9bd0-5a8259df33f3' }, { _reference: '3e9890e6-08a4-49fa-992c-6b83b61c7f66' }, { _reference: '57da4052-4bd9-4b6a-a953-9ae9a0e15244' }, { _reference: '2990ed28-fe8a-4273-870e-b74b2348606c'}] }, { ID: "0b77f14f-d022-4a55-80ab-462c86ebe741", Name: "销售工作记录", ParentID: "0b77f14f-d022-4a55-80ab-462c86ebe747", PathCode: "@001-007-001-004-001", children: [{ _reference: '0b77f14f-d022-4a55-80ab-462c86ebe742' }, { _reference: '0b77f14f-d022-4a55-80ab-462c86ebe743'}] }, { ID: "0b77f14f-d022-4a55-80ab-462c86ebe747", Name: "工作记录", ParentID: "17eae1ad-6f95-44bb-a231-3bfb8276ae8f", PathCode: "@001-007-001-005", children: [{ _reference: '0b77f14f-d022-4a55-80ab-462c86ebe741'}] }, { ID: "27eae1ad-6f95-44bb-a231-3bfb8276ae8f", Name: "销售管理", ParentID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf59", PathCode: "@001-007-002", children: [{ _reference: '8422fd66-5c4b-42dc-b473-15032fb1fd1a' }, { _reference: 'f27f665b-8735-4d55-acc7-2a441a21dc5b' }, { _reference: '2b63b417-d52f-41e5-9b9f-3478af233b0d' }, { _reference: '7b241866-54ba-4297-9809-74c13cc5e731' }, { _reference: '7b241866-54ba-4297-9809-74c13cc5e733' }, { _reference: '0b946bfc-0e70-48e7-93d6-7ee484b646c7' }, { _reference: '37ac0de3-aea4-45c8-88ca-f4e1140c448c'}] }, { ID: "296837c9-6cc8-4ae9-a978-23c616772b96", Name: "交付管理", ParentID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf59", PathCode: "@001-007-003", children: [{ _reference: '1a1184d1-a82c-4f1e-a23f-4bf852037258' }, { _reference: '9cf1abe7-4d7d-46d6-87a8-9bf7ab36abb3' }, { _reference: '78a9433b-9a7a-405e-a8e1-bd346a47f112'}] }, { ID: "296837c9-6cc8-4ae9-a978-23c616372b96", Name: "内训管理", ParentID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf59", PathCode: "@001-007-004", children: [{ _reference: 'a6d29ac3-4511-46ae-86d7-67b967680670' }, { _reference: 'e8a66f37-1961-4627-b76c-89ff30c70cfd'}] }, { ID: "f6b5968b-6d4f-498f-88b7-5a926cecdf95", Name: "会务管理", ParentID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf59", PathCode: "@001-007-005", children: [{ _reference: 'a73eff41-128a-46cc-bd98-21dc5c01dce8' }, { _reference: '86bc10c0-eee4-4973-9feb-88f9554f1943' }, { _reference: '86bc10c0-eee4-4973-9feb-88f9554f1944' }, { _reference: '29d20a27-a210-4fa8-877d-92795d975b78' }, { _reference: '3d235d5d-7618-474b-919e-abcd0a80ea31'}] }, { ID: "05134fbc-8955-48a1-950b-be77617bd4e5", Name: "报表管理", ParentID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf59", PathCode: "@001-007-006", children: [{ _reference: 'e46cfbf6-b23e-4ee9-a1d3-73e4a11423ec' }, { _reference: 'e4ab255b-fa1a-4e52-bd2b-879c24b68311' }, { _reference: 'e4ab255b-fa1a-4e52-bd2b-879c24b68341' }, { _reference: 'e4ab255b-fa1a-4e52-bd2b-879c24b68343' }, { _reference: 'e4ab255b-fa1a-4e52-bd2b-879c24b68346' }, { _reference: 'e4ab255b-fa1a-4e52-bd2b-879c24b68347'}] }, { ID: "523f637c-4be3-46ae-b428-cd1c879cdde1", Name: "历史数据录入", ParentID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf59", PathCode: "@001-007-007", children: [{ _reference: 'f5b26324-a587-42e5-8557-aed68a8eb561' }, { _reference: 'f5b26324-a587-42e5-8557-aed68a8eb562'}] }, { ID: "d1253f7e-441b-4fb8-aa93-19e86a9dcf51", Name: "我的任务", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-008", children: [{ _reference: '49f91ce2-d62e-4d06-b243-08fc0984f777' }, { _reference: '17eae1ad-6f95-44bb-a231-3bfb8276ae81' }, { _reference: '17eae1ad-6f95-44bb-a231-3bfb8276ae83' }, { _reference: '17eae1ad-6f95-44bb-a231-3bfb8276ae84' }, { _reference: '17eae1ad-6f95-44bb-a231-3bfb8276ae85' }, { _reference: '05da08d8-d3d7-41a2-ab0a-c4cc276dc97d' }, { _reference: '50066798-4d70-4c7b-8a44-cf114965b650'}] }, { ID: "67bcae26-16d1-4858-969c-8e643b966417", Name: "人力资源", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-009", children: [{ _reference: '697979f1-1ef1-4927-9a56-3d8ea3cc09ad' }, { _reference: '17d7f5ca-0df4-4427-898a-593cf927baa2' }, { _reference: 'bde74e42-d805-4cc4-b6ac-dc09b29d1c15'}] }, { ID: "37b40282-4c42-4b81-8d65-0f86c427fa4e", Name: "招聘管理", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-010", children: [{ _reference: 'ed5f4cb8-3e1a-4764-a618-1488716cc0ba' }, { _reference: '629f20db-f9a5-4d94-97ea-3cf93b067dc0' }, { _reference: 'bb8d52b3-84e0-4952-b407-6194feaad08e' }, { _reference: '5189cb2d-0b0b-477e-93df-8800d1fa0e0a' }, { _reference: 'e09cf85f-8f60-4355-8616-ecfe58cedcc6'}] }, { ID: "ad40759f-0d17-4896-930a-3aab8d09c3e6", Name: "知识管理", ParentID: "b931a16f-2859-45b3-ab02-b67ca89d38e9", PathCode: "@001-011", children: [{ _reference: '132fecf6-1286-4def-9334-0cac5581dd66'}]}] }
			        //treeStore = new dojo.data.ItemFileWriteStore({ data: _data });
			        var treeModel = new dijit.tree.ForestStoreModel({
			            store: treeStore,
			            query: { root: true }
			        });

			        var navTree = new dijit.Tree({ model: treeModel, showRoot: false }, "navTree")

			        navTree.onClick = function (item) {
			            /* load the url from datastore */
			            //location.href = item.url;
			            addTabPane(item.url, item.name, '0.2');
			        };
			    }
			    dojo.ready(initTree);



			    dojo.ready(function () {
			        var loadCompleteTime = +new Date();
			        console.log("Total load time: " + (loadCompleteTime - startTime) + "ms");

			        dojo.parser.parse(dojo.byId('container'));
			        console.info("Total parse time: " + (+new Date() - loadCompleteTime) + "ms");

			        dojo.byId('loaderInner').innerHTML += " done.";
			        setTimeout(function hideLoader() {
			            dojo.fadeOut({
			                node: 'loader',
			                duration: 500,
			                onEnd: function (n) {
			                    n.style.display = "none";
			                }
			            }).play();
			        }, 250);

			        logStrayGlobals();

			        // Fill in menu/links to get to other themes.		
			        // availableThemes[] is just a list of 'official' dijit themes, you can use ?theme=String
			        // for 'un-supported' themes, too. (eg: yours)
			        var availableThemes = [
						{ theme: "claro", author: "Dojo", baseUri: "../themes/" },
						{ theme: "tundra", author: "Dojo", baseUri: "../themes/" },
						{ theme: "soria", author: "nikolai", baseUri: "../themes/soria/" },
						{ theme: "nihilo", author: "nikolai", baseUri: "../themes/nihilo/" }
					];

			        var tmpString = '';
			        dojo.forEach(availableThemes, function (theme) {
			            tmpString +=
							'<a href="?theme=' + theme.theme + '">' + theme.theme + '</' + 'a> (' +
							'<a href="?theme=' + theme.theme + '&dir=rtl">RTL</' + 'a> ' +
							'<a href="?theme=' + theme.theme + '&a11y=true">high-contrast</' + 'a> ' +
							'<a href="?theme=' + theme.theme + '&dir=rtl&a11y=true">RTL+high-contrast</' + 'a> )' +
							' - by: ' + theme.author + ' <br>';
			            dijit.byId('themeMenu').addChild(new dijit.MenuItem({
			                label: theme.theme,
			                onClick: function () { location.search = "?theme=" + theme.theme; }
			            }))
			        });
			        //dojo.byId('themeData').innerHTML = tmpString;

			    });

			    dojo.ready(function () {
			        // It's the server's responsibility to localize the date displayed in the (non-edit) version of an InlineEditBox,
			        // but since we don't have a server we'll hack it in the client
			        //dijit.byId("backgroundArea").set('value', dojo.date.locale.format(new Date(2005, 11, 30), { selector: 'date' }));

			        // var nineAm = new Date(0);
			        //nineAm.setHours(9);
			        //dijit.byId("timePicker").set('value', dojo.date.locale.format(nineAm, { selector: 'time' }));
			    });

			    addTabPane = function (page, title, version) {
			        var p = dijit.byId("topTabs");
			        var url = page;
			        //var title = page.split("/").join(".");

			        //	get the children and make sure we haven't opened this yet.
			        var c = p.getChildren();
			        for (var i = 0; i < c.length; i++) {
			            if (c[i].title == title) {
			                p.selectChild(c[i]);
			                return;
			            }
			        }
			        var paneOnLoad = function () { }
			        var pane = new dijit.layout.ContentPane({
			            //href: url,
			            title: title,
			            closable: true,
			            content: "<iframe src='" + page + "' frameborder=0 width='100%' height='100%'></iframe>"
			            //parseOnLoad: false,
			            //onLoad: dojo.hitch(pane, paneOnLoad)
			        });
			        p.addChild(pane);
			        p.selectChild(pane);
			        return pane;
			    };

			    _addTabPage = addTabPane;

			    /***
			    dojo.ready(function({)
			    // use "before advice" to print log message each time resize is called on a layout widget
			    var origResize = dijit.layout._LayoutWidget.prototype.resize;
			    dijit.layout._LayoutWidget.prototype.resize = function(mb){
			    console.log(this + ": resize({w:"+ mb.w + ", h:" + mb.h + "})");
			    origResize.apply(this, arguments);
			    };
		
			    // content pane has no children so just use dojo's builtin after advice
			    dojo.connect(dijit.layout.ContentPane.prototype, "resize", function(mb){
			    console.log(this + ": resize({w:"+ mb.w + ", h:" + mb.h + "})");
			    });
			    });
			    ***/
			});
            
	</script>
    
</head>
<body class="claro">
    <div data-dojo-type="dijit/layout/BorderContainer" style="width: 100%; height: 100%;">
         <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">Top pane</div>
         <div data-dojo-type="dijit/layout/AccordionContainer" data-dojo-props="region:'leading'">
              <div data-dojo-type="dijit/layout/AccordionPane" title="pane #1">accordion pane #1</div>
              <div data-dojo-type="dijit/layout/AccordionPane" title="pane #2">accordion pane #2</div>
              <div data-dojo-type="dijit/layout/AccordionPane" title="pane #3">accordion pane #3</div>
         </div>
         <div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region:'center'">
              <div data-dojo-type="dijit/layout/ContentPane" title="tab #1">tab pane #1</div>
              <div data-dojo-type="dijit/layout/ContentPane" title="tab #2">tab pane #2</div>
              <div data-dojo-type="dijit/layout/ContentPane" title="tab #3">tab pane #3</div>
         </div>
         <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'trailing'">Trailing pane</div>
         <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'">Bottom pane</div>
    </div>

</body>
</html>
